Skip to content

feat: return AdReward via completion NSObject? for reward units#17

Merged
2sem merged 1 commit intomainfrom
feature/reward-ad-completion
Mar 10, 2026
Merged

feat: return AdReward via completion NSObject? for reward units#17
2sem merged 1 commit intomainfrom
feature/reward-ad-completion

Conversation

@2sem
Copy link
Owner

@2sem 2sem commented Mar 10, 2026

Summary

  • Add earnedRewards[E: AdReward] dictionary to store the reward during userDidEarnRewardHandler
  • On dismiss, pass earnedReward as NSObject? in the completion (non-reward units still receive the ad object)

Usage

manager.show(unit: .rewardedAd) { unit, obj, rewarded in
    if let reward = obj as? GoogleMobileAds.AdReward {
        // grant reward: reward.type, reward.amount
    }
}

🤖 Generated with Claude Code

Store earned reward in earnedRewards[unit] during userDidEarnRewardHandler,
then pass it as NSObject? in the show completion on dismiss.
Non-reward units continue to receive the ad object as before.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@2sem 2sem merged commit 709c444 into main Mar 10, 2026
2 checks passed
@github-actions
Copy link

🤖 Hi @2sem, I've received your request, and I'm working on it now! You can track my progress in the logs for more details.

@2sem 2sem deleted the feature/reward-ad-completion branch March 10, 2026 08:28
@github-actions
Copy link

🤖 I'm sorry @2sem, but I was unable to process your request. Please see the logs for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant